/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.financeiro.entity;

import br.jm.financeiro.filter.ConfiguraCampoAnnotation;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author joao
 */
@Entity
@Table(name = "exportar_excel", catalog = "salao", schema = "public")
@NamedQueries({
    @NamedQuery(name = "ExportarExcel.findAll", query = "SELECT e FROM ExportarExcel e")})
public class ExportarExcel implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_exportar", nullable = false)
    private Integer idExportar;
    @Column(name = "dsc_etapa", length = 200)
    private String dscEtapa;
    @Size(max = 50)
    @Column(name = "dsc_assunto", length = 50)
    private String dscAssunto;
    @Column(name = "vlr_etapa", precision = 18, scale = 2)
    private BigDecimal vlrEtapa;
    @Column(name = "perc_etapa", precision = 10, scale = 2)
    private BigDecimal percEtapa;
    @Size(max = 200)
    @Column(name = "dsc_perc", length = 200)
    private String dscPerc;
    @Column(name = "vlr_proposta", precision = 18, scale = 2)
    private BigDecimal vlrProposta;
    @Size(max = 200)
    @Column(name = "dsc_nfe", length = 200)
    private String dscNfe;
    @Column(name = "dat_emissao")
    @Temporal(TemporalType.DATE)
    private Date datEmissao;
    @Size(max = 200)
    @Column(name = "dsc_empresa", length = 200)
    private String dscEmpresa;
    @Column(name = "dat_pagamento")
    @Temporal(TemporalType.DATE)
    private Date datPagamento;
    @Size(max = 20)
    @Column(name = "num_ordem", length = 40)
    private String numOrdem;
    @Column(name = "vlr_liquido", precision = 18, scale = 2)
    private BigDecimal vlrLiquido;
    @Column(name = "vlr_custo_iss", precision = 18, scale = 2)
    private BigDecimal vlrCustoIss;
    @Column(name = "vlr_imposto", precision = 18, scale = 2)
    private BigDecimal vlrImposto;
    @Column(name = "vlr_multa", precision = 18, scale = 2)
    private BigDecimal vlrMulta;
    @Column(name = "vlr_juros", precision = 18, scale = 2)
    private BigDecimal vlrJuros;
    @Column(name = "vlr_pago", precision = 18, scale = 2)
    private BigDecimal vlrPago;
    @Column(name = "dat_venc_nota")
    @Temporal(TemporalType.DATE)
    private Date datVencNota;
    @Size(max = 1)
    @Column(name = "ord_status", length = 1, nullable = false)
    private String ordStatus;
    @JoinColumn(name = "id_proposta", referencedColumnName = "id_proposta", nullable = true)
    @ManyToOne(optional = true, fetch = FetchType.EAGER)
    private Proposta idProposta;
    @JoinColumn(name = "id_usuario", referencedColumnName = "id_usuario")
    @ManyToOne
    private Usuario idUsuario;
    @Column(name = "dsc_ord_status")
    private String dscOrdStatus;

    public ExportarExcel() {
    }

    public ExportarExcel(Integer idExportar) {
        this.idExportar = idExportar;
    }

    public Integer getIdExportar() {
        return idExportar;
    }

    public void setIdExportar(Integer idExportar) {
        this.idExportar = idExportar;
    }

    public Proposta getIdProposta() {
        return idProposta;
    }

    public void setIdProposta(Proposta idProposta) {
        this.idProposta = idProposta;
    }


    public Usuario getIdUsuario() {
        return idUsuario;
    }

    public void setIdUsuario(Usuario idUsuario) {
        this.idUsuario = idUsuario;
    }

    public void setOrdStatus(String ordStatus) {
        this.ordStatus = ordStatus;
    }

    public String getDscOrdStatus() {
        /*
        if (this.ordStatus == null) {
            this.dscOrdStatus = "Aberto";
        } else {
            switch (this.ordStatus) {
                case "A":
                    this.dscOrdStatus = "A Faturar";
                    break;
                case "F":
                    this.dscOrdStatus = "Faturado não Pago";
                    break;
                case "P":
                    this.dscOrdStatus = "Faturado Pago";
                    break;
                case "C":
                    this.dscOrdStatus = "Cancelado";
                    break;
            }
        }
                */
        return dscOrdStatus;
    }

    public void setDscOrdStatus(String dscOrdStatus) {
        this.dscOrdStatus = dscOrdStatus;
    }

    public String getDscEtapa() {
        return dscEtapa;
    }

    public void setDscEtapa(String dscEtapa) {
        this.dscEtapa = dscEtapa;
    }

    public String getDscAssunto() {
        return dscAssunto;
    }

    public void setDscAssunto(String dscAssunto) {
        this.dscAssunto = dscAssunto;
    }

    public BigDecimal getVlrEtapa() {
        return vlrEtapa;
    }

    public void setVlrEtapa(BigDecimal vlrEtapa) {
        this.vlrEtapa = vlrEtapa;
    }

    public BigDecimal getPercEtapa() {
        return percEtapa;
    }

    public void setPercEtapa(BigDecimal percEtapa) {
        this.percEtapa = percEtapa;
    }

    public String getDscPerc() {
        return dscPerc;
    }

    public void setDscPerc(String dscPerc) {
        this.dscPerc = dscPerc;
    }

    public BigDecimal getVlrProposta() {
        return vlrProposta;
    }

    public void setVlrProposta(BigDecimal vlrProposta) {
        this.vlrProposta = vlrProposta;
    }

    public String getDscNfe() {
        return dscNfe;
    }

    public void setDscNfe(String dscNfe) {
        this.dscNfe = dscNfe;
    }

    public Date getDatEmissao() {
        return datEmissao;
    }

    public void setDatEmissao(Date datEmissao) {
        this.datEmissao = datEmissao;
    }

    public String getDscEmpresa() {
        return dscEmpresa;
    }

    public void setDscEmpresa(String dscEmpresa) {
        this.dscEmpresa = dscEmpresa;
    }

    public Date getDatPagamento() {
        return datPagamento;
    }

    public void setDatPagamento(Date datPagamento) {
        this.datPagamento = datPagamento;
    }

    public String getNumOrdem() {
        return numOrdem;
    }

    public void setNumOrdem(String numOrdem) {
        this.numOrdem = numOrdem;
    }

    public BigDecimal getVlrLiquido() {
        return vlrLiquido;
    }

    public void setVlrLiquido(BigDecimal vlrLiquido) {
        this.vlrLiquido = vlrLiquido;
    }

    public BigDecimal getVlrCustoIss() {
        return vlrCustoIss;
    }

    public void setVlrCustoIss(BigDecimal vlrCustoIss) {
        this.vlrCustoIss = vlrCustoIss;
    }

    public BigDecimal getVlrImposto() {
        return vlrImposto;
    }

    public void setVlrImposto(BigDecimal vlrImposto) {
        this.vlrImposto = vlrImposto;
    }

    public BigDecimal getVlrMulta() {
        return vlrMulta;
    }

    public void setVlrMulta(BigDecimal vlrMulta) {
        this.vlrMulta = vlrMulta;
    }

    public BigDecimal getVlrJuros() {
        return vlrJuros;
    }

    public void setVlrJuros(BigDecimal vlrJuros) {
        this.vlrJuros = vlrJuros;
    }

    public BigDecimal getVlrPago() {
        return vlrPago;
    }

    public void setVlrPago(BigDecimal vlrPago) {
        this.vlrPago = vlrPago;
    }

    public Date getDatVencNota() {
        return datVencNota;
    }

    public void setDatVencNota(Date datVencNota) {
        this.datVencNota = datVencNota;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idExportar != null ? idExportar.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ExportarExcel)) {
            return false;
        }
        ExportarExcel other = (ExportarExcel) object;
        return !((this.idExportar == null && other.idExportar != null) || (this.idExportar != null && !this.idExportar.equals(other.idExportar)));
    }

    @Override
    public String toString() {
        return "br.jm.financeiro.entity.ExportarExcel[ idExportar=" + idExportar + " ]";
    }

}
